package com.hebg3.weixin.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hebg3.weixin.dao.UserMapper;
import com.hebg3.weixin.po.User;
import com.hebg3.weixin.po.UserExample;

@Service
public class UserService {

	@Autowired
	private UserMapper um;

	public User login(String username, String pwd) {
		UserExample ue = new UserExample();
		ue.createCriteria().andUsernameEqualTo(username).andPwdEqualTo(pwd);
		List<User> ul = um.selectByExample(ue);
		if (null == ul || ul.isEmpty()) {
			return null;
		} else {
			return ul.get(0);
		}
	}
}
